{$CLEO .qa}
{$USE CLEO+}
{$USE ini}
{$USE newOpcodes}

0000: NOP

script_name "ImDncq"

// By ArtemQa146

const
    Ped_1 = 25@
    Ped_2 = 26@
    Ped_3 = 27@
    Ped_4 = 28@
    select = 24@
    ped_dj = 23@
    dj_panel = 22@
    Interior_active = 30@
end


        // dance
        0AAA: 1@ = get_script_struct_named "BAR"
        0E40: get_current_hour 2@
        077E: get_active_interior_to 3@
        if and
            2@ >= 7
            2@ < 18
        then
            0A93: terminate_this_custom_script
        else
            if and
                0EEA: locate_char_distance_to_coordinates $player_actor pos 493.391 -22.7228 1000.6797 radius 25.0
                not 3@ == 0
                1@ > 0
            then
            
                repeat
                wait 0
                04ED: load_animation  "PedEventsMod"
                until 04EE:   animation "PedEventsMod" loaded
                select = 0
                31@ = 0
                077E: get_active_interior_to Interior_active
                
                while 0EA7: get_any_char_no_save_recursive 31@ progress_to 31@ char_to 0@
                    if select >= 4
                    then break
                    end
                    
                    if and
                        803B:   not $player_actor == 0@  // (int)
                        0EE4: locate_char_distance_to_char $player_actor char 0@ radius 70.0
                    then
                        if or
                            0611:   actor 0@ performing_animation "dnce_M_a"
                            0611:   actor 0@ performing_animation "dnce_M_b"
                            0611:   actor 0@ performing_animation "dnce_M_c"
                            0611:   actor 0@ performing_animation "dnce_M_d"
                            0611:   actor 0@ performing_animation "dnce_M_e"
                        then

                            089F: get_actor 0@ pedtype_to 8@
                            if
                                8@ == 4
                            then
                                gosub @Ped
                                0209: 1@ = random_int_in_ranges 1 5
                                if 1@ == 1
                                then 0812: AS_actor Ped_1(select,1i) perform_animation "dnc_m_a" IFP "PedEventsMod" framedelta 1000.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
                                end
                                if 1@ == 2
                                then 0812: AS_actor Ped_1(select,1i) perform_animation "dnc_m_b" IFP "PedEventsMod" framedelta 1000.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
                                end
                                if 1@ == 3
                                then 0812: AS_actor Ped_1(select,1i) perform_animation "dnc_m_c" IFP "PedEventsMod" framedelta 1000.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
                                end
                                if 1@ == 4
                                then 0812: AS_actor Ped_1(select,1i) perform_animation "dnc_m_d" IFP "PedEventsMod" framedelta 1000.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
                                end
                                select += 1
                                continue
                            end

                            if
                                8@ == 5
                            then
                                gosub @Ped
                                0209: 1@ = random_int_in_ranges 1 4
                                if 1@ == 1
                                then 0812: AS_actor Ped_1(select,1i) perform_animation "dnc_f_a" IFP "PedEventsMod" framedelta 1000.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
                                end
                                if 1@ == 2
                                then 0812: AS_actor Ped_1(select,1i) perform_animation "dnc_f_b" IFP "PedEventsMod" framedelta 1000.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
                                end
                                if 1@ == 3
                                then 0812: AS_actor Ped_1(select,1i) perform_animation "dnc_f_c" IFP "PedEventsMod" framedelta 1000.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
                                end
                                select += 1
                                continue
                            end
                        end
                    end
                end
                
                model.Load(14820)
                if
                    not model.Available(14820)
                then
                    repeat
                    wait 0
                    model.Load(14820)
                    until model.Available(14820)
                end
                model.Load(19)
                if
                    not model.Available(19)
                then
                    repeat
                    wait 0
                    model.Load(19)
                    until model.Available(19)
                end
                038B: load_requested_models

                0E01: create_object_no_save 14820 at 476.549 -14.9356 1003.58 offset 0 ground 0 to dj_panel
                0177: set_object dj_panel Z_angle_to 270.0
                07F7: set_object dj_panel destructible 0
                0382: set_object dj_panel collision_detection 0
                0566: link_object dj_panel to_interior Interior_active
                
                ped_dj = -1
                
                0AAA: 1@ = get_script_struct_named "U_IALHA"
                if
                    1@ > 0
                then
                    31@ = 0
                    while 0EA7: get_any_char_no_save_recursive 31@ progress_to 31@ char_to 0@
                        if and
                            803B:   not $player_actor == 0@  // (int)
                            0EE4: locate_char_distance_to_char $player_actor char 0@ radius 100.0
                            02F2:   actor 0@ model == 19
                            0611:   actor 0@ performing_animation "RAP_B_LOOP"
                            0EEA: locate_char_distance_to_coordinates 0@ pos 475.9508 -14.9029 1003.6953 radius 5.0
                        then
                            0812: AS_actor 0@ perform_animation "dj_panel" IFP "PedEventsMod" framedelta 1000.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
                            break
                        end
                    end
                else
                    009A: ped_dj = create_actor_pedtype 4 model 19 at 475.8708 -14.92113 1003.695
                    0E24: fix_char ped_dj ground 1 brightness 1 and_fade_in 0
                    0173: set_actor ped_dj) Z_angle_to 270.0
                    0860: link_actor ped_dj to_interior Interior_active
                    0812: AS_actor ped_dj perform_animation "dj_panel" IFP "PedEventsMod" framedelta 1000.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
                end
                
                
                model.Destroy(14820)
                model.Destroy(19)
                
                timera = 0

                repeat
                wait 0
                
                if and
                    056D:   actor Ped_1 defined
                    056D:   actor Ped_2 defined
                    056D:   actor Ped_3 defined
                    056D:   actor Ped_4 defined
                then
                else
                    repeat
                    wait 0
                    077E: get_active_interior_to 1@
                    until 803B:   not Interior_active == 1@  // (int)
                    break
                end
                
                if
                    timera > 10000
                then
                    gosub @Ped_1
                end
                
                if
                    timera > 10000
                then
                    gosub @Ped_2
                end
                
                if
                    timera > 10000
                then
                    gosub @Ped_3
                end
                
                if
                    timera > 10000
                then
                    gosub @Ped_4
                end
                
                if
                    056D:   actor ped_dj defined
                then
                    if
                        0457:   player $PLAYER_CHAR aiming_at_actor ped_dj
                    then
                        0E83: get_current_char_weaponinfo $PLAYER_ACTOR store_to 1@
                        0E89: get_weaponinfo_fire_type 1@ store_to 2@ //     
                        if or
                            2@ == 1 //  
                            2@ == 3 //   (  ..)
                        then
                            01C2: remove_references_to_actor Ped_1 // Like turning an actor into a random pedestrian
                            01C2: remove_references_to_actor Ped_2 // Like turning an actor into a random pedestrian
                            01C2: remove_references_to_actor Ped_3 // Like turning an actor into a random pedestrian
                            01C2: remove_references_to_actor Ped_4 // Like turning an actor into a random pedestrian

                            if 056D:   actor ped_dj defined
                            then 01C2: remove_references_to_actor ped_dj // Like turning an actor into a random pedestrian
                            end

                            repeat
                            wait 0

                            077E: get_active_interior_to 1@
                            until 803B:   not Interior_active == 1@  // (int)
                            break
                        end
                    end
                    
                    080E: get_actor ped_dj ped_event_to 1@
                    if or
                        1@ == 49
                        1@ == 9
                        051A:   actor ped_dj damaged_by_actor $PLAYER_ACTOR
                    then
                        01C2: remove_references_to_actor Ped_1 // Like turning an actor into a random pedestrian
                        01C2: remove_references_to_actor Ped_2 // Like turning an actor into a random pedestrian
                        01C2: remove_references_to_actor Ped_3 // Like turning an actor into a random pedestrian
                        01C2: remove_references_to_actor Ped_4 // Like turning an actor into a random pedestrian

                        if 056D:   actor ped_dj defined
                        then 01C2: remove_references_to_actor ped_dj // Like turning an actor into a random pedestrian
                        end

                        repeat
                        wait 0

                        077E: get_active_interior_to 1@
                        until 803B:   not Interior_active == 1@  // (int)
                        break
                    end
                end
                
                
                if or
                    0457:   player $PLAYER_CHAR aiming_at_actor Ped_1
                    0457:   player $PLAYER_CHAR aiming_at_actor Ped_2
                    0457:   player $PLAYER_CHAR aiming_at_actor Ped_3
                    0457:   player $PLAYER_CHAR aiming_at_actor Ped_4
                then
                    0E83: get_current_char_weaponinfo $PLAYER_ACTOR store_to 1@
                    0E89: get_weaponinfo_fire_type 1@ store_to 2@ //     
                    if or
                        2@ == 1 //  
                        2@ == 3 //   (  ..)
                    then
                        01C2: remove_references_to_actor Ped_1 // Like turning an actor into a random pedestrian
                        01C2: remove_references_to_actor Ped_2 // Like turning an actor into a random pedestrian
                        01C2: remove_references_to_actor Ped_3 // Like turning an actor into a random pedestrian
                        01C2: remove_references_to_actor Ped_4 // Like turning an actor into a random pedestrian
                        
                        if 056D:   actor ped_dj defined
                        then 01C2: remove_references_to_actor ped_dj // Like turning an actor into a random pedestrian
                        end

                        repeat
                        wait 0

                        077E: get_active_interior_to 1@
                        until 803B:   not Interior_active == 1@  // (int)
                        break
                    end
                end

                080E: get_actor Ped_1 ped_event_to 1@
                080E: get_actor Ped_2 ped_event_to 2@
                080E: get_actor Ped_3 ped_event_to 3@
                if or
                    1@ == 49
                    1@ == 9
                    2@ == 49
                    2@ == 9
                    3@ == 49
                    3@ == 9
                then
                    01C2: remove_references_to_actor Ped_1 // Like turning an actor into a random pedestrian
                    01C2: remove_references_to_actor Ped_2 // Like turning an actor into a random pedestrian
                    01C2: remove_references_to_actor Ped_3 // Like turning an actor into a random pedestrian
                    01C2: remove_references_to_actor Ped_4 // Like turning an actor into a random pedestrian
                    
                    if 056D:   actor ped_dj defined
                    then 01C2: remove_references_to_actor ped_dj // Like turning an actor into a random pedestrian
                    end

                    repeat
                    wait 0

                    077E: get_active_interior_to 1@
                    until 803B:   not Interior_active == 1@  // (int)
                    break
                end

                080E: get_actor Ped_4 ped_event_to 1@
                if or
                    051A:   actor Ped_1 damaged_by_actor $PLAYER_ACTOR
                    051A:   actor Ped_2 damaged_by_actor $PLAYER_ACTOR
                    051A:   actor Ped_3 damaged_by_actor $PLAYER_ACTOR
                    051A:   actor Ped_4 damaged_by_actor $PLAYER_ACTOR
                    1@ == 49
                    1@ == 9
                then
                    01C2: remove_references_to_actor Ped_1 // Like turning an actor into a random pedestrian
                    01C2: remove_references_to_actor Ped_2 // Like turning an actor into a random pedestrian
                    01C2: remove_references_to_actor Ped_3 // Like turning an actor into a random pedestrian
                    01C2: remove_references_to_actor Ped_4 // Like turning an actor into a random pedestrian
                    
                    if 056D:   actor ped_dj defined
                    then 01C2: remove_references_to_actor ped_dj // Like turning an actor into a random pedestrian
                    end

                    repeat
                    wait 0

                    077E: get_active_interior_to 1@
                    until 803B:   not Interior_active == 1@  // (int)

                    break
                end

                077E: get_active_interior_to 1@
                until 803B:   not Interior_active == 1@  // (int)
                
                if 056D:   actor Ped_1 defined
                then 009B: destroy_actor Ped_1
                end
                if 056D:   actor Ped_2 defined
                then 009B: destroy_actor Ped_2
                end
                if 056D:   actor Ped_3 defined
                then 009B: destroy_actor Ped_3
                end
                if 056D:   actor Ped_4 defined
                then 009B: destroy_actor Ped_4
                end
                if 056D:   actor ped_dj defined
                then 009B: destroy_actor ped_dj
                end
                
                if 03CA:   object dj_panel exists
                then 0108: destroy_object dj_panel
                end
                
                04EF: release_animation "PedEventsMod"
                
                0A93: terminate_this_custom_script
                

            end
        end

0A93: terminate_this_custom_script

:Ped
04C4: store_coords_to 4@ 5@ 6@ from_actor 0@ with_offset 0.0 0.0 0.0
0172: 7@ = actor 0@ Z_angle
04C4: store_coords_to 1@ 2@ 3@ from_actor 0@ with_offset 0.0 0.0 70.0
00A1: put_actor 0@ at 1@ 2@ 3@
0575: set_actor 0@ pinned_position 1
0665: get_actor 0@ model_to 2@
model.Load(2@)
if
    not model.Available(2@)
then
    repeat
    wait 0
    model.Load(2@)
    until model.Available(2@)
end
038B: load_requested_models

009A: Ped_1(select,1i) = create_actor_pedtype 8@ model 2@ at 4@ 5@ 6@
0E24: fix_char Ped_1(select,1i) ground 1 brightness 1 and_fade_in 0
0173: set_actor Ped_1(select,1i) Z_angle_to 7@
0860: link_actor Ped_1(select,1i) to_interior Interior_active
model.Destroy(2@)
return

:Ped_1
if or
    0611:   actor Ped_1 performing_animation "dnc_m_a"
    0611:   actor Ped_1 performing_animation "dnc_m_b"
    0611:   actor Ped_1 performing_animation "dnc_m_c"
    0611:   actor Ped_1 performing_animation "dnc_m_d"
    0611:   actor Ped_1 performing_animation "dnc_f_a"
    0611:   actor Ped_1 performing_animation "dnc_f_b"
    0611:   actor Ped_1 performing_animation "dnc_f_c"
then
    if 0611:   actor Ped_1 performing_animation "dnc_m_a"
    then 0613: 1@ = actor Ped_1 animation "dnc_m_a" time
    end
    if 0611:   actor Ped_1 performing_animation "dnc_m_b"
    then 0613: 1@ = actor Ped_1 animation "dnc_m_b" time
    end
    if 0611:   actor Ped_1 performing_animation "dnc_m_c"
    then 0613: 1@ = actor Ped_1 animation "dnc_m_c" time
    end
    if 0611:   actor Ped_1 performing_animation "dnc_m_d"
    then 0613: 1@ = actor Ped_1 animation "dnc_m_d" time
    end

    if 0611:   actor Ped_1 performing_animation "dnc_f_a"
    then 0613: 1@ = actor Ped_1 animation "dnc_f_a" time
    end
    if 0611:   actor Ped_1 performing_animation "dnc_f_b"
    then 0613: 1@ = actor Ped_1 animation "dnc_f_b" time
    end
    if 0611:   actor Ped_1 performing_animation "dnc_f_c"
    then 0613: 1@ = actor Ped_1 animation "dnc_f_c" time
    end

    if
        1@ > 0.95
    then
        089F: get_actor Ped_1 pedtype_to 1@
        if
            1@ == 4
        then
            0209: 1@ = random_int_in_ranges 1 5
            if 1@ == 1
            then 0812: AS_actor Ped_1 perform_animation "dnc_m_a" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 2
            then 0812: AS_actor Ped_1 perform_animation "dnc_m_b" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 3
            then 0812: AS_actor Ped_1 perform_animation "dnc_m_c" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 4
            then 0812: AS_actor Ped_1 perform_animation "dnc_m_d" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            timera = 0
            return
        end

        if
            1@ == 5
        then
            0209: 1@ = random_int_in_ranges 1 4
            if 1@ == 1
            then 0812: AS_actor Ped_1 perform_animation "dnc_f_a" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 2
            then 0812: AS_actor Ped_1 perform_animation "dnc_f_b" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 3
            then 0812: AS_actor Ped_1 perform_animation "dnc_f_c" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            timera = 0
            return
        end
    end
end
return

:Ped_2
if or
    0611:   actor Ped_2 performing_animation "dnc_m_a"
    0611:   actor Ped_2 performing_animation "dnc_m_b"
    0611:   actor Ped_2 performing_animation "dnc_m_c"
    0611:   actor Ped_2 performing_animation "dnc_m_d"
    0611:   actor Ped_2 performing_animation "dnc_f_a"
    0611:   actor Ped_2 performing_animation "dnc_f_b"
    0611:   actor Ped_2 performing_animation "dnc_f_c"
then
    if 0611:   actor Ped_2 performing_animation "dnc_m_a"
    then 0613: 1@ = actor Ped_2 animation "dnc_m_a" time
    end
    if 0611:   actor Ped_2 performing_animation "dnc_m_b"
    then 0613: 1@ = actor Ped_2 animation "dnc_m_b" time
    end
    if 0611:   actor Ped_2 performing_animation "dnc_m_c"
    then 0613: 1@ = actor Ped_2 animation "dnc_m_c" time
    end
    if 0611:   actor Ped_2 performing_animation "dnc_m_d"
    then 0613: 1@ = actor Ped_2 animation "dnc_m_d" time
    end

    if 0611:   actor Ped_2 performing_animation "dnc_f_a"
    then 0613: 1@ = actor Ped_2 animation "dnc_f_a" time
    end
    if 0611:   actor Ped_2 performing_animation "dnc_f_b"
    then 0613: 1@ = actor Ped_2 animation "dnc_f_b" time
    end
    if 0611:   actor Ped_2 performing_animation "dnc_f_c"
    then 0613: 1@ = actor Ped_2 animation "dnc_f_c" time
    end

    if
        1@ > 0.95
    then
        089F: get_actor Ped_2 pedtype_to 1@
        if
            1@ == 4
        then
            0209: 1@ = random_int_in_ranges 1 5
            if 1@ == 1
            then 0812: AS_actor Ped_2 perform_animation "dnc_m_a" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 2
            then 0812: AS_actor Ped_2 perform_animation "dnc_m_b" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 3
            then 0812: AS_actor Ped_2 perform_animation "dnc_m_c" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 4
            then 0812: AS_actor Ped_2 perform_animation "dnc_m_d" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            timera = 0
            return
        end

        if
            1@ == 5
        then
            0209: 1@ = random_int_in_ranges 1 4
            if 1@ == 1
            then 0812: AS_actor Ped_2 perform_animation "dnc_f_a" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 2
            then 0812: AS_actor Ped_2 perform_animation "dnc_f_b" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 3
            then 0812: AS_actor Ped_2 perform_animation "dnc_f_c" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            timera = 0
            return
        end
    end
end
return

:Ped_3
if or
    0611:   actor Ped_3 performing_animation "dnc_m_a"
    0611:   actor Ped_3 performing_animation "dnc_m_b"
    0611:   actor Ped_3 performing_animation "dnc_m_c"
    0611:   actor Ped_3 performing_animation "dnc_m_d"
    0611:   actor Ped_3 performing_animation "dnc_f_a"
    0611:   actor Ped_3 performing_animation "dnc_f_b"
    0611:   actor Ped_3 performing_animation "dnc_f_c"
then
    if 0611:   actor Ped_3 performing_animation "dnc_m_a"
    then 0613: 1@ = actor Ped_3 animation "dnc_m_a" time
    end
    if 0611:   actor Ped_3 performing_animation "dnc_m_b"
    then 0613: 1@ = actor Ped_3 animation "dnc_m_b" time
    end
    if 0611:   actor Ped_3 performing_animation "dnc_m_c"
    then 0613: 1@ = actor Ped_3 animation "dnc_m_c" time
    end
    if 0611:   actor Ped_3 performing_animation "dnc_m_d"
    then 0613: 1@ = actor Ped_3 animation "dnc_m_d" time
    end

    if 0611:   actor Ped_3 performing_animation "dnc_f_a"
    then 0613: 1@ = actor Ped_3 animation "dnc_f_a" time
    end
    if 0611:   actor Ped_3 performing_animation "dnc_f_b"
    then 0613: 1@ = actor Ped_3 animation "dnc_f_b" time
    end
    if 0611:   actor Ped_3 performing_animation "dnc_f_c"
    then 0613: 1@ = actor Ped_3 animation "dnc_f_c" time
    end

    if
        1@ > 0.95
    then
        089F: get_actor Ped_3 pedtype_to 1@
        if
            1@ == 4
        then
            0209: 1@ = random_int_in_ranges 1 5
            if 1@ == 1
            then 0812: AS_actor Ped_3 perform_animation "dnc_m_a" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 2
            then 0812: AS_actor Ped_3 perform_animation "dnc_m_b" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 3
            then 0812: AS_actor Ped_3 perform_animation "dnc_m_c" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 4
            then 0812: AS_actor Ped_3 perform_animation "dnc_m_d" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            timera = 0
            return
        end

        if
            1@ == 5
        then
            0209: 1@ = random_int_in_ranges 1 4
            if 1@ == 1
            then 0812: AS_actor Ped_3 perform_animation "dnc_f_a" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 2
            then 0812: AS_actor Ped_3 perform_animation "dnc_f_b" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 3
            then 0812: AS_actor Ped_3 perform_animation "dnc_f_c" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            timera = 0
            return
        end
    end
end
return

:Ped_4
if or
    0611:   actor Ped_4 performing_animation "dnc_m_a"
    0611:   actor Ped_4 performing_animation "dnc_m_b"
    0611:   actor Ped_4 performing_animation "dnc_m_c"
    0611:   actor Ped_4 performing_animation "dnc_m_d"
    0611:   actor Ped_4 performing_animation "dnc_f_a"
    0611:   actor Ped_4 performing_animation "dnc_f_b"
    0611:   actor Ped_4 performing_animation "dnc_f_c"
then
    if 0611:   actor Ped_4 performing_animation "dnc_m_a"
    then 0613: 1@ = actor Ped_4 animation "dnc_m_a" time
    end
    if 0611:   actor Ped_4 performing_animation "dnc_m_b"
    then 0613: 1@ = actor Ped_4 animation "dnc_m_b" time
    end
    if 0611:   actor Ped_4 performing_animation "dnc_m_c"
    then 0613: 1@ = actor Ped_4 animation "dnc_m_c" time
    end
    if 0611:   actor Ped_4 performing_animation "dnc_m_d"
    then 0613: 1@ = actor Ped_4 animation "dnc_m_d" time
    end

    if 0611:   actor Ped_4 performing_animation "dnc_f_a"
    then 0613: 1@ = actor Ped_4 animation "dnc_f_a" time
    end
    if 0611:   actor Ped_4 performing_animation "dnc_f_b"
    then 0613: 1@ = actor Ped_4 animation "dnc_f_b" time
    end
    if 0611:   actor Ped_4 performing_animation "dnc_f_c"
    then 0613: 1@ = actor Ped_4 animation "dnc_f_c" time
    end

    if
        1@ > 0.95
    then
        089F: get_actor Ped_4 pedtype_to 1@
        if
            1@ == 4
        then
            0209: 1@ = random_int_in_ranges 1 5
            if 1@ == 1
            then 0812: AS_actor Ped_4 perform_animation "dnc_m_a" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 2
            then 0812: AS_actor Ped_4 perform_animation "dnc_m_b" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 3
            then 0812: AS_actor Ped_4 perform_animation "dnc_m_c" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 4
            then 0812: AS_actor Ped_4 perform_animation "dnc_m_d" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            timera = 0
            return
        end

        if
            1@ == 5
        then
            0209: 1@ = random_int_in_ranges 1 4
            if 1@ == 1
            then 0812: AS_actor Ped_4 perform_animation "dnc_f_a" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 2
            then 0812: AS_actor Ped_4 perform_animation "dnc_f_b" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            if 1@ == 3
            then 0812: AS_actor Ped_4 perform_animation "dnc_f_c" IFP "PedEventsMod" framedelta 2.0 loopA 1 lockX 0 lockY 0 lockF 0 time -1  // versionB
            end
            timera = 0
            return
        end
    end
end
return
